<extend name="Public:layout"/>
<block name="content">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 菜单列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
        <div class="padding border-bottom">
            <ul class="search" style="padding-left:10px;">
                <li><a class="btn btn-primary btn-lg icon-plus" href="{:U('edit')}"> 添加菜单</a></li>
                <li><a class="btn btn-info btn-lg icon-reorder sort-list">批量排序</a></li>
                <li>搜索：</li>
                <li>
                    <input type="text" placeholder="请输入搜索关键字" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block">
                    <a href="javascript:void(0)" class="btn btn-primary btn-lg icon-search" onclick="changesearch()"> 搜索</a></li>

            </ul>
        </div>

        <table class="table table-hover text-center">
            <thead>
                <tr>
                    <th width="100" style="text-align:left; padding-left:20px;">ID</th>
                    <th style="width:10%;text-align:left">排序</th>
                    <th style="text-align:left">菜单</th>
                    <th>地址</th>
                    <th>备注</th>
                    <th>状态</th>
                    <th width="310">操作</th>
                </tr>
            </thead>
            <tbody>
                <empty name="list">
                        <tr>
                            <td colspan="20">没有更多的数据了</td>
                        </tr>
                    <else/>
                    <form action="{:U('index')}" id="sort-list" method="post">
                        <foreach name="list" item="vo">
                            <tr>
                                <td style="text-align:left; padding-left:20px;">{$vo.menu_id}</td>
                                <td style="width:10%"><input type="text" class="input sort-input" pk="{$vo.menu_id}" value="{$vo.sort}"  style="width:70%"></td>
                                <td style="text-align:left; padding-left:20px;">
                                    <switch name="vo.level">
                                        <case value="1"></case>
                                        <case value="2">&nbsp;&nbsp;&nbsp;|-</case>
                                        <case value="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|-</case>
                                    </switch>
                                    {$vo.menu_name}
                                </td>
                                <td>{$vo.url}</td>
                                <td>{$vo.remark}</td>
                                <td>{$vo['status'] ? '正常' : '禁用'}</td>
                                <td>
                                    <div class="btn-group">
                                        <a class="btn btn-primary" href="{:U('edit', 'menu_id='.$vo['menu_id'])}"><span class="icon-edit"></span> 修改</a>
                                        <a class="btn btn-info" href="{:U('setting', 'menu_id='.$vo['menu_id'])}"><span class="icon-group"></span> 配置</a>
                                        <a class="btn btn-danger ajax-click" href="javascript:void(0)" data-url="{:U('del', 'menu_id='.$vo['menu_id'])}"><span class="icon-trash-o"></span> 删除</a>
                                    </div>
                                </td>
                            </tr>
                        </foreach>
                    </form>
                </empty>

            </tbody>
            <tfoot>
                <tr>
                    <td colspan="8"><div class="pagelist"> {$page} </div></td>
                </tr>
            </tfoot>
        </table>
    </div>
</block>